package com.dz.scrm.app.config

import okhttp3.Interceptor
import okhttp3.Response

/**
 * 作者：fanda
 * 日期：2021/4/21 16:50
 * 描述：各种拦截器配置
 */

class  HttpHeaderInterceptor : Interceptor{
    override fun intercept(chain: Interceptor.Chain): Response {
        //  配置请求头
        val request = chain.request().newBuilder()
                .header("Content-Type", "application/json")
//                .header("Accept", "application/json")
//                .addHeader("Connection", "Keep-Alive")
//                .addHeader("Accept-Encoding", "gzip")
                .addHeader("Authorization", "Basic Y3JtOmNybV9zZWNyZXQ=")
//                .addHeader("Dz-Auth", "bearer eyJ0eXAiOiJKc29uV2ViVG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3N1c2VyIiwiYXVkIjoiYXVkaWVuY2UiLCJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJyb2xlX25hbWUiOiJhZG1pbmlzdHJhdG9yIiwidXNlcl9pZCI6IjExMjM1OTg4MjE3Mzg2NzUyMDEiLCJyb2xlX2lkIjoiMTEyMzU5ODgxNjczODY3NTIwMSIsInVzZXJfbmFtZSI6ImFkbWluIiwicmVhbF9uYW1lIjoi566h55CG5ZGYIiwidG9rZW5fdHlwZSI6ImFjY2Vzc190b2tlbiIsImRlcHRfaWQiOiIxMTIzNTk4ODEzNzM4Njc1MjAxIiwiYWNjb3VudCI6ImFkbWluIiwiY2xpZW50X2lkIjoiY3JtIiwiZXhwIjoxNjIwMzg4ODg1LCJuYmYiOjE2MjAzNTI4ODV9.0VmtnVf_42h3PnP-Y8UeVWZDjWafIB7KmyfLNNrB764=")
                .build()
        return chain.proceed(request)
    }
}